{include file="public/header"}
<title>认证</title>
    <style>
        .button{
            width:114px;
            height:38px;
            color: #FFFFFF;
            font-size: 14px;
            text-align:center;
            line-height:38px;
            border-radius:4px;
            background:#3463E6;
            margin:0 423px;
            margin-top:20px;
        }
        body{
            width:100%;
            height:100%;
            margin:0;
            padding:0;
            background-color: #F7F7F7;
        }
        /*头部*/
        .top{
            height: 60px;
            width: 100%;
            background:rgba(22,26,39,1);
        }
        .top_box{
            width: 1200px;
            height: 100%;
            margin: 0 auto;
            align-items: center;

        }
        .top_name_left{
            width:38px;
            height:38px;
            background:rgba(52,99,230,1);
            border-radius:10px;
            margin-right: 10px;
        }
        .top_name{
            height:60px;
            font-size:24px;
            font-family:PingFangSC-Medium;
            font-weight:500;
            color:rgba(255,255,255,1);
            line-height:60px;
        }
        .top_name_r{
            width:76px;
            height:30px;
            border-radius:15px;
            border:1px solid rgba(255,255,255,1);
            margin-left:26px;
            align-items: center;
            justify-content: center;
            display: flex;
        }
        .top_name_r img{
            height: 16px;
            width: 16px;
        }
        .top_name_r span{
            height:22px;
            line-height: 22px;
            font-size:16px;
            font-family:PingFangSC-Regular;
            font-weight:400;
            color:rgba(255,255,255,1);
            margin-left: 3px;
        }
        .lii{
            height:22px;
            font-size:16px;
            font-family:PingFangSC-Regular;
            font-weight:400;
            color:rgba(255,255,255,1);
            line-height:22px;
            margin-right: 24px;
        }
        .top_login{
            margin-left: 36px;
            display: flex;
            align-items: center;
        }
        .top_login img{
            width: 28px;
            height: 28px;
        }
        .top_login span{
            height:22px;
            font-size:16px;
            font-family:PingFangSC-Regular;
            font-weight:400;
            color:rgba(255,255,255,1);
            line-height:22px;
            margin-left: 8px;
        }
        .top_marginR{
            margin-right: 16px;
        }
        /*头部*/

        /*footer1样式*/
        .footer{
            width:100%;
            height:130px;
            background:rgba(31,31,31,1);
            display: flex;
            align-items: center;
        }
        .footer_in{
            width: 1210px;
            margin: 0 auto;
            height:18px;
            font-size:13px;
            font-family:PingFangSC-Regular;
            font-weight:400;
            color:rgba(153,153,153,1);
            line-height:18px;
        }
        /*footer1样式*/
        .bar{
            width:1200px;
            height:57px;
            align-items:center;
            margin: 0 auto;
            font-size:12px;
            color:#999999;
        }
        .right_arrow{
            width:14px;
            height:14px;
            margin-left:6px;
            margin-right:6px;
        }
        .box{
            width:1200px;
            margin: 0 auto;
            margin-bottom:73px;
        }
        .left{
            width:150px;
            background:#FFFFFF;
            box-shadow:0px 4px 10px 0px rgba(0,0,0,0.04);
            border-radius:4px;
            margin-right:20px;
            height: 520px;
        }
        .right{
            width:1030px;
            background:#FFFFFF;
            box-shadow:0px 4px 10px 0px rgba(0,0,0,0.04);
            border-radius:4px;
            padding-left:283px;
            padding-bottom: 30px;
        }
        .avatar,.avatar img{
            width:80px;
            height:80px;
            border-radius:50%;
        }
        .avatar{
            margin:20px auto 10px;
        }
        .avatar img{
            object-fit: cover;
        }
        .phone{
            text-align:center;
            font-size:14px;
            color:#333;
            margin-bottom:20px;
        }
        .title{
            font-size:14px;
            color:#333;
            height:40px;
            line-height:40px;
            text-align: left;
            width: 58px;
            padding: 0 46px;
        }
        .hover:hover{
            text-decoration:underline;
            cursor:hand;
            cursor:pointer;
        }
        .blue{
            font-size:14px;
            color:#FFFFFF;
            height:40px;
            line-height:40px;
            text-align: left;
            width: 58px;
            padding: 0 46px;
            background-color:#3463E6;
        }
        .right_tit{
            height:60px;
            line-height:60px;
            padding-left:21px;
            font-size:15px;
            color:#333333;
            border-bottom:1px solid #EDEDED;
        }
        .active{
            color:#3463E6;
            border-bottom:2px solid #3463E6;
            border-radius:2px;
        }
        .right1{
            margin-left:43px;
        }
        .avatar1,.avatar1 img{
            width:120px;
            height:120px;
            border-radius:50%;
        }
        .avatar1{
            position:relative;
            margin:60px auto 60px;
        }
        .avatar1 img{
            object-fit: cover;
        }
        .mengban{
            position:absolute;
            top:0;
            left:0;
            width:120px;
            height:120px;
            text-align:center;
            line-height:120px;
            border-radius:50%;
            background:rgba(0,0,0,0);
            font-size:14px;
            color:#FFFFFF;
            opacity:0;
        }
        .mengban:hover{
            background:rgba(0,0,0,0.4);
            opacity:1;
        }
        .cName{
            line-height:40px;
            font-size:14px;
            color:#999;
        }
        input[type='text']{
            -webkit-appearance: none;
            outline: none;
            background: transparent;
            width:468px;
            height:40px;
            color: #666;
            font-size: 14px;
            margin: 0;
            padding-left:10px;
            padding-right:10px;
            border:1px solid #D0D0D0;
            border-radius:4px;
            margin-left:16px;
        }
        select{
            /*-webkit-appearance: none;*/
            /*outline: none;*/
            /*background: transparent;*/
            width:468px;
            height:40px;
            color: #666;
            font-size: 14px;
            margin: 0;
            padding-left:10px;
            padding-right:10px;
            border:1px solid #D0D0D0;
            border-radius:4px;
            margin-left:16px;
        }

        input::-webkit-input-placeholder {
            color: #AAAAAA;
            font-size: 14px;
        }
        .button{
            width:114px;
            height:38px;
            color: #FFFFFF;
            font-size: 14px;
            text-align:center;
            line-height:38px;
            border-radius:4px;
            background:#3463E6;
            float:right;
        }


        .right_top{
            width:56px;
            font-size:14px;
            font-weight:600;
            color:rgba(51,51,51,1);
            line-height:40px;

        }

        .top2{
            padding-top:20px;
            padding-bottom:20px;
        }


        textarea[type='text']{
            -webkit-appearance: none;
            outline: none;
            background: transparent;
            width:468px;
            height:148px;
            color: #666;
            font-size: 14px;
            margin: 0;
            padding-left:10px;
            padding-right:10px;
            padding-top:10px;
            border:1px solid #D0D0D0;
            border-radius:4px;
            margin-left:16px;
            line-height: 20px;
            font: 400 13.3333px Arial;

        }

        textarea::-webkit-input-placeholder {
            color: #AAAAAA;
            font-size: 14px;
            font: 400 13.3333px Arial;
        }


        .right_new1{
            padding-top:24px;
            padding-bottom:16px;
            width:75px;
            height:21px;
            font-size:15px;
            font-weight:500;
            color:rgba(51,51,51,1);
            line-height:21px;

        }


        .right_new2{
            padding-top:40px;
            padding-bottom:16px;
            width:75px;
            height:21px;
            font-size:15px;
            font-weight:500;
            color:rgba(51,51,51,1);
            line-height:21px;
        }
        .right_new3{
            padding-top:40px;
            padding-bottom:16px;
            width:120px;
            height:21px;
            font-size:15px;
            font-weight:500;
            color:rgba(51,51,51,1);
            line-height:21px;

        }


        .s_l{

            position: relative;
            width:227px;
            height:124px;
            background:rgba(249,250,252,1);
            border-radius:2px;
            border:1px solid rgba(137,173,241,1);
        }
        /*.s_l::before{
          content: '';
          width: 200%;
          height: 200%;
          position: absolute;
          border: 1px dashed rgba(6,101,243,0.5);
          top: -50%;
          left: -50%;
          -webkit-transform: scale(.5);
          box-sizing: border-box;
        }*/
        .s_l_in1,.s_l_in2{
            width: 100%;
            height: 38px;
            text-align: center;
            margin: auto;
            position: absolute;
            top: -19px;
            bottom: 0;
        }
        .s_l_in1 div{
            font-size:14px;
            font-weight:500;
            color:rgba(52,99,230,1);
            margin-top: 8px;
        }
        .s_l_in2 div{
            color: #fff;
            font-size: 0.65rem;
            line-height: 18px;
            margin-top: 8px;
        }
        .s_l_in1 img,.s_l_in2 img{
            width: 26px;
            height: 26px;
            display: block;
            margin: 0 auto;
        }

        .s_mid{
            width: 10px;
            height: 100%;
        }



        .s_r{
            width:227px;
            height:124px;
            background:rgba(241,244,248,1);
            border-radius:2px;
        }
        .s_li{
            width: 100%;
            height: -webkit-fill-available;
            /*background: rgba(226,226,226,.5);*/
        }
        .s_li span{
            width:40px;
            height:20px;
            font-size:12px;
            font-weight:400;
            color:rgba(255,255,255,1);
            line-height:17px;
            float: right;
            background:#212121;
            text-align: center;
            line-height: 20px;
        }

        .right_newall{
            padding-bottom:10px;

        }
        #avatarImg{
            width: 227px;
            height: 124px;
            position:absolute;
            top:0;
            left:0;
            z-index:2;

        }
        .hidden{
            display:none;
        }
        #deleteImg{
            position:absolute;
            top:0;
            right:0;
            width:20px;
            height:20px;
            z-index:3;
        }



    </style>
<body>

<div class="box flex-wrap">
    {include file="public/body"}
    {if $data['user_type'] >= 2}
    <form id="fabutask">
    <div class="flex-con right">
        <div class="right_new1">身份证上传</div>
        <div class="right_newall flex-wrap">
            <div class="s_l">
                <!--<img src="" alt="" id="avatarImg" class="hidden">-->
                <!--<img src="__IMG__/main4_add.png" alt="" id="deleteImg" class="hidden">-->
                <!--<img src="__IMG__/main4_add.png" alt="">-->
                <div class="s_l_in1">
                    <img src="__IMG__/main4_add.png" alt="" class="uploadimg">
                    <!--<img src="__IMG__/main4_add.png" alt="" id="imgsrc">-->
                    <input type="file" accept="image/*" id="fileimg" onChange="previewimg(this)" style="display:none;" name ="input_image" >
                    <div class="uploadimg">上传身份证正面</div>
                </div>
            </div>
            <div class="s_mid"></div>
            <div class="flex-con">
                <div class="s_r">
                    <div class="s_li" style="width: 554px;">
                        <img src="{$data['user_zheng']!='' ?? '__IMG__/01.png'}" alt="" id="imgsrc" style="width:45%;height:124px">
                        <img src="__IMG__/01.png" alt="" style="width:45%;height:124px" class="imgsrc {if !$data['user_zhizhao']}hidden{/if}">
                    </div>
                </div>
            </div>
        </div>

        <div class="right_newall flex-wrap">
            <div class="s_l">
                <div class="s_l_in1">
                    <img src="__IMG__/main4_add.png" alt="" class="uploadimg1">
                    <input type="file" accept="image/*" id="fileimg1" onChange="previewimg1(this)" style="display:none;" name ="input_image1" >
                    <div class="uploadimg1">上传身份证反面</div>
                </div>
            </div>
            <div class="s_mid"></div>
            <div class="flex-con">
                <div class="s_r">
                    <div class="s_li" style="width: 554px;">
                        <img src="{$data['user_fan']!='' ?? '__IMG__/02.png'}" alt="" id="imgsrc1" style="width:45%;height:124px">
                        <img src="__IMG__/02.png" alt="" style="width:45%;height:124px" class="imgsrc1 {if !$data['user_zhizhao']}hidden{/if}">
                    </div>
                </div>
            </div>
        </div>



        <div class="right_new2">名片上传</div>
        <div class="right_newall flex-wrap">
            <div class="s_l">
                <div class="s_l_in1">
                    <img src="__IMG__/main4_add.png" alt="" class="uploadimg2">
                    <input type="file" accept="image/*" id="fileimg2" onChange="previewimg2(this)" style="display:none;" name ="input_image2" >
                    <div class="uploadimg2">上传名片</div>
                </div>
            </div>
            <div class="s_mid"></div>
            <div class="flex-con">
                <div class="s_r">
                    <div class="s_li" style="width: 554px;">
                        <img src="{$data['user_card']!='' ?? '__IMG__/03.png'}"  alt="" id="imgsrc2" style="width:45%;height:124px">
                        <img src="__IMG__/03.png" alt="" style="width:45%;height:124px" class="imgsrc2 {if !$data['user_zhizhao']}hidden{/if}">
                    </div>
                </div>
            </div>
        </div>
        <div class="right_new3">公司营业执照上传</div>
        <div class="right_newall flex-wrap">
            <div class="s_l">
                <div class="s_l_in1">
                    <img src="__IMG__/main4_add.png" alt="" class="uploadimg3">

                    <input type="file" accept="image/*" id="fileimg3" onChange="previewimg3(this)" style="display:none;" name ="input_image3" >

                    <div class="uploadimg3">上传公司营业执照</div>
                </div>
            </div>
            <div class="s_mid"></div>
            <div class="flex-con">
                <div class="s_r">
                    <div class="s_li" style="width: 554px;">
                        <img src="{$data['user_zhizhao']!='' ?? '__IMG__/04.png'}" alt="" id="imgsrc3" style="width:45%;height:124px">
                        <img src="__IMG__/04.png" alt="" style="width:45%;height:124px" class="imgsrc3 {if !$data['user_zhizhao']}hidden{/if}">
                    </div>
                    <!--<div class="s_li">-->
                        <!--<img src="__IMG__/04.png" alt="" style="width:100%;height:124px">-->
                    <!--</div>-->
                </div>
            </div>
        </div>
        <div class="right_new3">公司名称</div>
        {if $data.user_type == 2 || $data['user_status']==0 || $data['user_status']==1 || $data['user_status']==3}
        <div class="right_newall flex-wrap">
            <input type="text" name="com_name" id="com_name" value="{$data['user_shop']}" {if $data['user_status']!=2 && $data['user_status']!=4}readonly{/if} />
        </div>
        {/if}
        {if $data.user_type == 3}
        {if $data['user_status']==2 || $data['user_status']==4}
        <div class="right_newall flex-wrap">
            <select name="com_name" id="com_name">
                {volist name='coms' id='c'}
                <option value="{$c.id}" {if $data['user_company_id_3']==$c.id}selected{/if}>{$c.name}</option>
                {/volist}
            </select>
        </div>
        {/if}
        {/if}
        <!--审核结果-->
        <div class="right_newall flex-wrap" style="color: red;">
            {if $data.user_status == 1}审核通过{/if}
            {if $data.user_status == 0}审核中！{/if}
            {if $data.user_status == 2}审核未通过，原因：{$data.user_reject_reason}{/if}
        </div>
        <!--end-->
        {if $data['user_status']==2 || $data['user_status']==4}
        <div class="button btn">确定修改</div>
        {/if}
        <input type="hidden" name="task_image" id="task_image" value="{$data['user_zheng']}"/><!--为1没传图  为2已传图-->
        <input type="hidden" name="task_image1" id="task_image1" value="{$data['user_fan']}"/><!--为1没传图  为2已传图-->
        <input type="hidden" name="task_image2" id="task_image2" value="{$data['user_card']}"/><!--为1没传图  为2已传图-->
        <input type="hidden" name="task_image3" id="task_image3" value="{$data['user_zhizhao']}"/><!--为1没传图  为2已传图-->

    </div>
    </form>
    {/if}
</div>
<!--状态-->
<input type="hidden" id="shenhe" value="{$data['user_status']}"/><!--是否审核-->

{include file="public/foot1"}
</body>
<script src="/static/admin/js/jquery.min.js"></script>
<script type="text/javascript" src="__JSS__/plugins/layui/layui.all.js"></script>
<script type="text/javascript" src="__JS__/wk.js"></script>
<script type="text/javascript" src="__JS__/webuploader/webuploader.js"></script>
<script src="__JS__/common.js" ></script>
<script>

    $('.uploadimg').click(function () {
        var shenhe = $('#shenhe').val();
        if(shenhe == 2 || shenhe == 4){
            $('#fileimg').click();
        }else{
            alert('只有审核未通过或者未审核才能提交修改！');
        }
    });
    function previewimg(obj){
        var src = window.URL.createObjectURL(obj.files[0]);
//        $('#avatarImg').removeClass('hidden');
//        $('#deleteImg').removeClass('hidden');
        $('#imgsrc').attr('src',src);
        $('.imgsrc').removeClass('hidden');
//        $('.imgshow').removeClass('hidden');
        uploadImageCommon('fabutask','task_image');
    }


    $('.uploadimg1').click(function () {
        var shenhe = $('#shenhe').val();
        if(shenhe == 2 || shenhe == 4){
            $('#fileimg1').click();
        }else{
            alert('只有审核未通过或者未审核才能提交修改！');
        }
    });
    function previewimg1(obj){
        var src = window.URL.createObjectURL(obj.files[0]);
//        $('#avatarImg').removeClass('hidden');
//        $('#deleteImg').removeClass('hidden');
        $('#imgsrc1').attr('src',src);
        $('.imgsrc1').removeClass('hidden');
//        $('.imgshow').removeClass('hidden');
        uploadImageCommon1('fabutask','task_image1');
    }


    $('.uploadimg2').click(function () {
        var shenhe = $('#shenhe').val();
        if(shenhe == 2 || shenhe == 4){
            $('#fileimg2').click();
        }else{
            alert('只有审核未通过或者未审核才能提交修改！');
        }
    });
    function previewimg2(obj){
        var src = window.URL.createObjectURL(obj.files[0]);
//        $('#avatarImg').removeClass('hidden');
//        $('#deleteImg').removeClass('hidden');
        $('#imgsrc2').attr('src',src);
        $('.imgsrc2').removeClass('hidden');
//        $('.imgshow').removeClass('hidden');
        uploadImageCommon2('fabutask','task_image2');
    }


    $('.uploadimg3').click(function () {
        var shenhe = $('#shenhe').val();
        if(shenhe == 2 || shenhe == 4){
            $('#fileimg3').click();
        }else{
            alert('只有审核未通过或者未审核才能提交修改！');
        }
    });
    function previewimg3(obj){
        var src = window.URL.createObjectURL(obj.files[0]);
//        $('#avatarImg').removeClass('hidden');
//        $('#deleteImg').removeClass('hidden');
        $('#imgsrc3').attr('src',src);
        $('.imgsrc3').removeClass('hidden');
//        $('.imgshow').removeClass('hidden');
        uploadImageCommon3('fabutask','task_image3');
    }
//    $('#deleteImg').click(function(){
//        $('#avatarImg').attr('src','');
//        $('#avatarImg').addClass('hidden');
//        $('#deleteImg').addClass('hidden');
//    })
</script>
<script>
    $('.btn').click(function () {
//        var formData = new FormData($( "#fabutask" )[0]);//addForm是表单的id，不是input file的
//        formData.append("task_content", editor.txt.html());
//        formData.append("task_share_content", editor2.txt.html());
//        var repeatSubmit = $('#repeatSubmit').val();
//        if(repeatSubmit == 2){
//            alert('请勿重复提交！');
//            return false;
//        }else{
//            var submitInfo = formCheck();
//            if(submitInfo.status == 200){
//                $('#repeatSubmit').val(2);
        var shenhe = $('#shenhe').val();
        if(shenhe == 2 || shenhe == 4){
            var task_image = $("#task_image").val();
            var task_image1 = $("#task_image1").val();
            var task_image2 = $("#task_image2").val();
            var task_image3 = $("#task_image3").val();
            var task_image3 = $("#task_image3").val();
            var com_name = $("#com_name").val().trim();
            if(task_image == '' || task_image1 == '' || task_image2 == '' || task_image3 == ''){
                alert('有图片未上传！');
                return;
            }
            if(com_name == ''){
                alert('公司名字不能为空！');
                return;
            }
            var formData = $( "#fabutask" ).serialize();
            $(this).attr('disabled','disabled').html('提交中...');
            $.ajax({
                url: '/home/User/attestation',
                data: formData,
                type: 'POST',
                dataType: 'JSON',
                success: function (returnData) {
                    alert(returnData.msg);
                    if(returnData.code == 200){
//                    window.location.reload();
                        window.location.href = '/home/User/attestation';
//                            return true;

                    }
                },
                error: function () {
                    alert('服务器错误，请刷新重试！');
                }
            })
        }else{
            alert('只有审核未通过或者未审核才能提交修改！');
        }

//        }
    });
</script>
</html>
